import { GridData } from "./GridData";
import { GridView } from "./GridView";

class Main {
    constructor() {
        Laya3D.init(Laya.Browser.clientWidth, Laya.Browser.clientHeight);
        Laya.stage.scaleMode = Laya.Stage.SCALE_EXACTFIT;
        Laya.stage.screenMode = Laya.Stage.SCREEN_HORIZONTAL;
        Laya.stage.alignV = Laya.Stage.ALIGN_MIDDLE;
        Laya.stage.alignH = Laya.Stage.ALIGN_CENTER;

        const gridData = new GridData(120, 80);
        const gridView = new GridView(gridData);

        Laya.stage.addChild(gridView);

        // 设置起始点
        gridData.setStartNode(0, 2);
        gridData.setEndNode(100, 70);

        //获得路径
        gridView.drawGrid();
    }
}

new Main();
